package com.yan.consumer.controller;


import com.yan.consumer.entity.User;
import com.yan.consumer.feigin.FeignService;
import com.yan.consumer.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户 前端控制器
 * </p>
 *
 * @author zwq
 * @since 2021-03-19
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @Autowired
    private FeignService feignService;
    @Transactional
    @GetMapping("save")
    public String save(){
        User user = new User();
        user.setAge(111);
        user.setCode("hhh");
        user.setName("大侠22");
        userService.save(user);
        feignService.save();
        return "hah";
    }

}

